from django.contrib import admin
# from master.models import Demo, DemoClass
#
#
# class DemoAdmin(admin.ModelAdmin):
#     list_display = ('id', 'name', 'value')  # 默认只显示显示一列，list_display指定显示列，存在多对多关系的列不能指定显示和可编辑
#     list_editable = ('name', 'value')  # 显示界面可编辑的列
#     list_per_page = 10  # 每页显示行数
#     # ordering = ('id')  # 排序，默认升序，前面加-则降序
#     search_fields = ('name', 'value')  # 显示搜索框，在搜索框内可通过指定字段进行搜索
#
#     # list_filter = ('age', 'cls')  # 过滤选项
#     # fieldsets = [(None, {'fields': ['sname', 'cls']}),
#     #              ('other information', {'fields': ['gender', 'age'], 'classes': ['collapse']})]  # 添加时非必要信息折叠不显示
#     # filter_horizontal = ('case_id',)  #仅限多对多列使用，对存在多对多的列可搜索
#     # filter_vertical = ('case_id')  #同上
#
#     def get_queryset(self, request):
#         qs = super(DemoAdmin, self).get_queryset(request)
#         if request.user.is_superuser:
#             return qs
#         return qs.filter(author=request.user)
#
#
# # Register your models here.
# admin.site.register(Demo, DemoAdmin)
# admin.site.register(DemoClass)
